const state = {
  couponList:[],
  balance:0
}

const mutations = {
  TOGGLE_couPon_LIST: (state, device) => {
    state.couponList = device.couponList!==null?device.couponList:[]
    state.balance = device.balance
  },
  TOGGLE_DEL_LIST: (state) => {
    state.couponList = []
    state.balance = 0
  },
}

const actions = {
  getCouponList({ commit }, device) {
    commit('TOGGLE_couPon_LIST', device)
  },
  delCouponList({ commit }) {
    commit('TOGGLE_DEL_LIST')
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
